<template>
	<view class="workerView">
		<view class="Workers" v-for="(item,index) in repairsData" :key="index">
			<view class="Worker"
				@click="go(item.id)">
				<view class="Peoples">
					<view class="random">
						<view class="crack">
							{{item.content}}
						</view>
						<!-- <view class="peoplecrack">请物管及时排工人大大大的</view> -->
					</view>
					<view class="Img" >
						<view class="ZongImg" v-for="(it,index) in item.images" :key="index">
							<image :src="it.url?IMAGE_BASE_URL+it.url:'../../static/images/bb.png'" mode=""></image>
						</view>
					</view>
					<view class="Address">
						<view class="Housenumber">
							{{item.address}}
						</view>
						<view class="Questions">
							{{item.content}}
						</view>
					</view>
					<view class=""></view>
				</view>
				<view class="PerpleTimeOut">
					<view class="DayTime">
						{{item.addtime.substr(0,10)}}
					</view>
					<view class="revoke">
						<view class="onhandle">
							未处理
						</view>
						<view class="onrevoke">
							撤销
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		questionsList
	} from "../../apis/index.js"
	import {
		IMAGE_BASE_URL
	} from '@/config/index.js'
	export default {
		data() {
			return {
				IMAGE_BASE_URL: IMAGE_BASE_URL,
				repairsData: [],
			imagesUrl:[]
			}
		},
		created() {
			this.getquestionsList()
		},
		methods: {
			go(id){
				// console.log('12121',id);
				uni.navigateTo({
					url:"/pages/Recordadetails/Recordadetails?id="+id
				})
			},
			async getquestionsList() {
				let res = await questionsList()
				console.log("我的报修列表", res);
				res.list.map(item=>{
					this.imagesUrl=item.images
					
				})
				console.log(this.imagesUrl);
				this.repairsData = res.list
				
			}
		}
	}
</script>

<style lang="less">
	.Workers {
		height: 520rpx;
		// margin: 21rpx 13rpx 21rpx 13rpx;
		padding: 21rpx 13rpx;
		background-color: #fff;
		margin-bottom: 23rpx;
	}

	.workerView {
		width: 100%;


		.random {
			padding-top: 60rpx;
			padding-right: 0rpx;
			padding-left: 46rpx;
			font-size: 26rpx;

			.crack {
				width: 95%;
				display: -webkit-box;
				/* 限制最大行数 */
				-webkit-line-clamp: 2;
				/* 垂直布局 */
				-webkit-box-orient: vertical;
				/* 超出部分隐藏 */
				overflow: hidden;
				/* 显示省略号 */
				text-overflow: ellipsis;
			}
		}

		.Img {
			display: flex;
			justify-content: space-between;
			margin: auto 50rpx;

			image {
				width: 185rpx;
				height: 154rpx;
				border-radius: 1rpx;
				margin-top: 30rpx;
			}
		}

		.Address {
			display: flex;
			justify-content: space-between;
			align-items: center;
			color: #666666;
			font-size: 21rpx;
			position: relative;

			.Housenumber {
				position: absolute;
				left: 40rpx;
				top: 40rpx;
			}

			.Questions {
				position: absolute;
				right: 45rpx;
				top: 40rpx;
			}
		}

		.PerpleTimeOut {
			display: flex;
			margin-top: 100rpx;
			position: relative;
			border-top: 3rpx solid #f0eeee;
			padding-top: 20rpx;

			.revoke {
				display: flex;

				// position: relative;			
			}
		}

		.DayTime {
			position: absolute;
			left: 42rpx;
			top: 15rpx;
			font-size: 19rpx;
			color: #666666;
		}

		.revoke {
			position: absolute;
			right: 42rpx;
			top: 15rpx;
			font-size: 22rpx;
			color: #666666;

			.onhandle {
				// height: 55rpx;
				border: 5rpx solid #acaeb1;
				padding: 12rpx 30rpx;
				border-radius: 15rpx;
			}

			.onrevoke {
				// border: 5rpx solid #acaeb1;
				padding: 12rpx 38rpx;
				border-radius: 15rpx;
				margin-left: 25rpx;
				background-color: #00a2f1;
				font-size: 24rpx;
				color: #fff;
			}
		}
	}
	.ZongImg{
		width: 100%;
		display: flex;
		padding-right: 20rpx;
	}
</style>